<template>
	<view class="window-main" style="justify-content: flex-end;" v-if="showAdviceWindow">
		<view class="advice-window">
			<image class="shadow" src="../static/common/bg_shadow_window_full.png"></image>
			<text class="title">问题及建议</text>
			<view class="main-box">
				<text class="font-000-32" style="font-weight: 600;">问题</text>
				<view class="single-advice-box" v-for="(item,index) in adviceList" :key="index"
				 @click="chosenAdviceId = item.id">
					<text class="font-333-30">{{item.content}}</text>
					<image class="chosen-icon" src="../static/common/ic_chosen_true.png"
					 v-if="item.id == chosenAdviceId"></image>
					<image class="chosen-icon" src="../static/common/ic_chosen_false.png" v-else></image>
				</view>
				<text class="font-000-32" style="font-weight: 600;margin-top: 30rpx;">建议</text>
				<textarea
					v-model="suggestion"
					class="suggestion-area"
					placeholder="请输入留言(选填)"
					placeholder-class="font-99-28"
				></textarea>
				<view class="row-container-row-between" style="width: 100%;">
					<text class="cancel-btn" @click="showAdviceWindow = false">取消</text>
					<text class="confirm-btn" @click="handleCommitAdvice">确认</text>
				</view>
				
			</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		name:"AdviceWindow",
		data() {
			return {
				showAdviceWindow:false,
				adviceList:[
					{id : 1 , content:'复制店名到美团APP搜不到' , chosen:false},
					{id : 2 , content:'无法跳转到美团平台' , chosen:false},
					{id : 3 , content:'店铺名称错误' , chosen:false},
					{id : 4 , content:'店铺地址错误' , chosen:false},
					{id : 5 , content:'商家服务态度差' , chosen:false},
					{id : 6 , content:'商家产品质量差' , chosen:false}
				],
				chosenAdviceId:-1,
				suggestion:''
				
			};
		},
		
		methods:{
			handleCommitAdvice(){
				this.showAdviceWindow = false
			}
		}
	}
</script>

<style lang="scss">
	.advice-window{
		display: flex;
		flex-direction: column;
		width: 100%;
		position: relative;
		background: white;
		border-top-left-radius: 16rpx;
		border-top-right-radius: 16rpx;
		align-items: center;
		
		.shadow{
			width: 100%;
			height: 220rpx;
			position: absolute;
			top: 0;
		}
		
		.title{
			color:#333333;
			font-size: 36rpx;
			font-weight: 600;
			margin-top: 44rpx;
			z-index: 110;
		}
		
		.main-box{
			display: flex;
			flex-direction: column;
			width: calc(100% - 88rpx);
			margin-top: 20rpx;
			padding-bottom: 44rpx;
			
			.single-advice-box{
				width: 100%;
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: space-between;
				margin-top: 26rpx;
				
				.chosen-icon{
					width: 36rpx;
					height: 36rpx;
					margin-left: 14rpx;
				}
			}
			
			.suggestion-area{
				margin-top: 16rpx;
				width: 100%;
				height: 196rpx;
				background: #F5F5F5;
				border-radius: 10rpx;
				color: #333333;
				font-size: 28rpx;
				padding: 20rpx;
				margin-bottom: 44rpx;
			}
			
			.cancel-btn{
				flex-grow: 1;
				height: 88rpx;
				background: #F5F5F5;
				border: #E0E0E0 solid 1rpx;
				border-radius: 10rpx;
				margin-right: 15rpx;
				color: #333333;
				font-size: 32rpx;
				text-align: center;
				line-height: 88rpx;
			}
			
			.confirm-btn{
				flex-grow: 1;
				height: 88rpx;
				background: #FFD100;
				border-radius: 10rpx;
				margin-left: 15rpx;
				color: #333333;
				font-weight: 600;
				font-size: 32rpx;
				text-align: center;
				line-height: 88rpx;
			}
			
			
		}
	}
</style>